package org.liqingye.es.service;

import java.util.List;
import java.util.Map;

import org.elasticsearch.rest.RestStatus;
import org.liqingye.es.page.Page;

public interface BaseSearchService {

    RestStatus indexRequest(String index, String id, String jsonStr) throws Exception;

    RestStatus indexRequest(String index, String id, Map<String, Object> jsonMap) throws Exception;

    Map<String, Object> getRequest(String index, String id) throws Exception;

    RestStatus deleteResponse(String index, String id) throws Exception;

    boolean deleteResponse(String index) throws Exception;

    RestStatus updateRequest(String index, String id, Map<String, Object> jsonMap) throws Exception;

    RestStatus updateRequest(String index, String id, String jsonStr) throws Exception;

    List<Map<String, Object>> query(String index, String keyword, List<String> fields, int from, int size,
            List<String> descNames) throws Exception;

    List<Map<String, Object>> queryHighLightBykeyword(String index, String keyword, List<String> fields, int from,
            int size, List<String> descNames) throws Exception;

    Page<Map<String, Object>> queryHighLightPageBykeyword(String index, String keyword, List<String> fields,
            int pageNum, int pageSize, List<String> descNames) throws Exception;

    List<Map<String, Object>> query(String index, String keyword, List<String> fields, List<String> descNames)
            throws Exception;

    List<Map<String, Object>> queryHighLightBykeyword(String index, String keyword, List<String> fields,
            List<String> descNames) throws Exception;
}
